----------------------------------------------------------------------------------------------------------------------------------
--[[

    血梅香

    remain time  ：留存时间
    damage time  : 伤害时间

]]--
----------------------------------------------------------------------------------------------------------------------------------
local hutao_com_blood_plum_scent_for_debuff = Class(function(self, inst)
    self.inst = inst

    self.__remain_time = net_float(inst.GUID,"hutao_com_blood_plum_scent_for_debuff.remain_time","blood_plum_scent_data_update")
    self.__damage_time = net_float(inst.GUID,"hutao_com_blood_plum_scent_for_debuff.damage_time","blood_plum_scent_data_update")

    self.__damage_time_scale = net_float(inst.GUID,"hutao_com_blood_plum_scent_for_debuff.damage_time_scale","blood_plum_scent_data_update")

    self.__player = net_entity(inst.GUID,"hutao_com_blood_plum_scent_for_debuff.player")
    self.__player_userid = net_string(inst.GUID,"hutao_com_blood_plum_scent_for_debuff.player_userid")

    self.__target = net_entity(inst.GUID,"hutao_com_blood_plum_scent_for_debuff.target")

end)
------------------------------------------------------------------------------------------------------------------------------
--
    function hutao_com_blood_plum_scent_for_debuff:SetRemainTime(time)
        self.__remain_time:set(time)
    end
    function hutao_com_blood_plum_scent_for_debuff:GetRemainTime()
        return self.__remain_time:value()
    end
    function hutao_com_blood_plum_scent_for_debuff:SetDamageTime(time)
        self.__damage_time:set(time)
    end
    function hutao_com_blood_plum_scent_for_debuff:GetDamageTime()
        return self.__damage_time:value()
    end
------------------------------------------------------------------------------------------------------------------------------
-- 玩家绑定，双重net 保险
    function hutao_com_blood_plum_scent_for_debuff:SetPlayer(player)
        if player and player.userid then
            self.__player:set(player)
            self.__player_userid:set(player.userid)
        end
    end
    function hutao_com_blood_plum_scent_for_debuff:GetPlayer()
        local player = self.__player:value()
        if player then
            return player
        end
        local userid = self.__player_userid:value()
        for k, v in pairs(AllPlayers) do
            if v.userid == userid then
                return v
            end
        end
        return nil
    end
------------------------------------------------------------------------------------------------------------------------------
-- target
    function hutao_com_blood_plum_scent_for_debuff:SetTarget(target)
        self.__target:set(target)
    end
    function hutao_com_blood_plum_scent_for_debuff:GetTarget()
        local target = self.__target:value()
        if target then
            return target
        end
        target = self.inst.entity:GetParent()
        return target
    end
------------------------------------------------------------------------------------------------------------------------------
--
    function hutao_com_blood_plum_scent_for_debuff:SetDamageTimeScale(time)
        self.__damage_time_scale:set(time)
    end
    function hutao_com_blood_plum_scent_for_debuff:GetDamageTimeScale()
        local ret = self.__damage_time_scale:value()
        if ret == 0 then
            ret = 1
        end
        return ret
    end
------------------------------------------------------------------------------------------------------------------------------
return hutao_com_blood_plum_scent_for_debuff







